home *** CD-ROM | disk | FTP | other *** search
/ Medabots Cardz / Medabots CD Cardz Rokusho.bin / pc / assets / rokusho.dxr / 00211_Script_211 < prev    next >
Text File  |  2001-12-07  |  2KB  |  42 lines

  1. property beginscore, myFile, squam
  2.  
  3. on beginsprite me
  4.   set the floatPrecision = 0
  5.   squam = getOSdirectory()&"\"
  6.   if objectP(myFile) then set myFile = 0  --Delete the instance if it already exists
  7.   myFile = new(xtra "fileio") -- Create an instance of FileIO
  8.   --  openFile(myFile,the moviePath&"info.txt",1) --Open the file with read access
  9.   openFile(myFile,squam&"infor.txt",0) --Open the file with read access
  10.   myVariable = readFile(myFile) --set the variable 'myVariable' to the text of the file 'info.txt'
  11.   if readFile(myFile)=VOID then --checks to see if this file exists
  12.     createFile (myFile, squam&"infor.txt")
  13.     openFile(myFile,squam&"infor.txt",0)
  14.     beginscore = 100
  15.     put beginscore into member("holdscore")  
  16.     mySaveString = member("holdscore").text
  17.     writeString(myFile,mySaveString)
  18.   else
  19.     beginscore = myVariable
  20.     closeFile(myFile) -- Close the file
  21.   end if
  22.   myFile = 0 -- Dispose of the instance
  23.   
  24.   --
  25.   --  
  26.   --  if objectP(myFile) then set myFile = 0  --Delete the instance if it already exists
  27.   --  myFile = new(xtra "fileio")    -- Create an instance of FileIO
  28.   --  --  openFile (myFile, the moviePath &"info.txt",0)--Open the file with R/W access  
  29.   --  openFile (myFile, squam&"info.txt",0)--Open the file with R/W access  
  30.   --  delete(myFile) --deletes the file
  31.   --  --  createFile (myFile, the moviePath &"info.txt") --creates the file again
  32.   --  createFile (myFile, squam&"info.txt") --creates the file again
  33.   --  --  openFile(myFile,the moviePath &"info.txt",0) --Open the file with R/W access
  34.   --  openFile(myFile, squam&"info.txt",0) --Open the file with R/W access
  35.   --  --  mySaveString = thescore --puts the contents of the field 'input' into the variable mySaveString
  36.   --  mySaveString = member("holdscore").text
  37.   --  writeString(myFile,mySaveString) --writes text to the file
  38.   --  
  39.   --  closeFile(myFile) -- Close the file 
  40.   --  myFile = 0 -- Dispose of the instance
  41. end
  42.